package com.dm.service.use_token;


import com.dm.vo.DmUserVO;


public interface TokenService {
    /**
     * 获取token字符串
     *
     * @param user
     * @param agent
     * @return
     * @throws Exception
     */
    public String getToken(String agent, DmUserVO user) throws Exception;



    /**
     * 保存token
     *
     * @param token
     * @param user
     * @return
     * @throws Exception
     */
    public Boolean saveToken(String token, DmUserVO user) throws Exception;

    /**
     * 保存key=id,value=token
     * @param id
     * @param token
     * @return
     * @throws Exception
     */
    public Boolean saveTokenById(String id, String token) throws Exception;

    /**
     * 验证token是否存在
     * @param id
     * @return
     * @throws Exception
     */
    public String validateToken(String id) throws Exception;
    /**
     * 删除token
     *
     * @param token
     * @throws Exception
     */

    public void deleteToken(String token) throws Exception;





}
